
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="utf-8" />
    <title>最家</title>
    <link rel="stylesheet" type="text/css" href="${APP_PATH}/portal/css/public.css"/>
    <link rel="stylesheet" type="text/css" href="${APP_PATH}/portal/css/index.css" />
</head>
<body>
<!------------------------------head------------------------------>
<jsp:include page="/WEB-INF/jsps/Portal/common/top.jsp"/>
<!-------------------------banner--------------------------->
<div class="block_home_slider">
    <div id="home_slider" class="flexslider">
        <ul class="slides">
            <li>
                <div class="slide">
                    <img src="${APP_PATH}/portal/img/banner2.jpg"/>
                </div>
            </li>
            <li>
                <div class="slide">
                    <img src="${APP_PATH}/portal/img/banner1.jpg"/>
                </div>
            </li>
        </ul>
    </div>
</div>

<!------------------------------thImg------------------------------>
<div class="thImg">
    <div class="clearfix">
        <a href="${APP_PATH}/toKindsTypeGoods?kid=87&ktid=16"><img src="${APP_PATH}/portal/img/i1.jpg"/></a>
        <a href="${APP_PATH}/toKindsTypeGoods?kid=87&ktid=15"><img src="${APP_PATH}/portal/img/i2.jpg"/></a>
        <a href="${APP_PATH}/toKindsGoods2?kid=89"><img src="${APP_PATH}/portal/img/i3.jpg"/></a>
    </div>
</div>

<!------------------------------news------------------------------>
<div class="news">
    <div class="wrapper">
        <h2><img src="${APP_PATH}/portal/img/ih1.jpg"/></h2>
        <div class="top clearfix">
            <a href="${APP_PATH}/toKindsTypeGoods?kid=87&ktid=16"><img src="${APP_PATH}/portal/img/n1.jpg"/><p></p></a>
            <a href="${APP_PATH}/toKindsTypeGoods?kid=87&ktid=16"><img src="${APP_PATH}/portal/img/n2.jpg"/><p></p></a>
            <a href="${APP_PATH}/toKindsTypeGoods?kid=87&ktid=16"><img src="${APP_PATH}/portal/img/n3.jpg"/><p></p></a>
        </div>
        <div class="bott clearfix">
            <a href="${APP_PATH}/toKindsTypeGoods?kid=87&ktid=16"><img src="${APP_PATH}/portal/img/n4.jpg"/><p></p></a>
            <a href="${APP_PATH}/toKindsTypeGoods?kid=87&ktid=16"><img src="${APP_PATH}/portal/img/n5.jpg"/><p></p></a>
            <a href="${APP_PATH}/toKindsTypeGoods?kid=87&ktid=16"><img src="${APP_PATH}/portal/img/n6.jpg"/><p></p></a>
        </div>
        <h2><img src="${APP_PATH}/portal/img/ih2.jpg"/></h2>
        <div id="news1" class="flower clearfix tran" style="width: 1150px; margin: 0 auto;">
        </div>

        <div id="news2" class="flower clearfix tran" style="width: 1150px; margin: 0 auto;">
        </div>
    </div>
</div>

<!------------------------------ad------------------------------>
<a href="javascript:;" class="ad"><img src="${APP_PATH}/portal/img/ib1.jpg"/></a>

<!------------------------------people------------------------------>
<div class="people">
    <div class="wrapper">
        <h2><img src="${APP_PATH}/portal/img/ih3.jpg"/></h2>
        <div id="news3_row1" class="pList clearfix tran" style="width: 1200px; margin: 0 auto;">
        </div>
        <div id="news3_row2" class="pList clearfix tran" style="width: 1200px; margin: 0 auto;">
        </div>
        <div id="news3_row3" class="pList clearfix tran" style="width: 1200px; margin: 0 auto;">
        </div>
    </div>
</div>
<!--返回顶部-->
<jsp:include page="/WEB-INF/jsps/Portal/common/gotop.jsp"/>

<!-------------------login-------------------------->
<!--footer-->
<jsp:include page="/WEB-INF/jsps/Portal/common/bottom.jsp"/>

<script src="${APP_PATH}/portal/js/jquery-1.12.4.min.js" type="text/javascript" charset="utf-8"></script>
<script src="${APP_PATH}/portal/js/public.js" type="text/javascript" charset="utf-8"></script>
<script src="${APP_PATH}/portal/js/nav.js" type="text/javascript" charset="utf-8"></script>
<script src="${APP_PATH}/portal/js/jquery.flexslider-min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
    $(function() {
        $('#home_slider').flexslider({
            animation: 'slide',
            controlNav: true,
            directionNav: true,
            animationLoop: true,
            slideshow: true,
            slideshowSpeed:2000,
            useCSS: false
        });

        getNews();
    });

    function getNews() {
        $.ajax({
            url : "${APP_PATH}/goods/getNews",
            method : "GET",
            success : function (result) {
                if(result.success){
                    var news1 = result.data.news1;
                    var news2 = result.data.news2;
                    var news3 = result.data.news3;
                    var news1Content = "";
                    var news2Content = "";
                    var news3Content = "";
                    for(var i = 0 ; i < news1.length ; i ++){
                        news1Content +='<a href="${APP_PATH}/toFurnitureDetail?ktid='+news1[i].kt_ktid+'&fid='+news1[i].fid+'" >';
                        news1Content +='<dl>';
                        news1Content +='<dt>';
                        news1Content +='<span class="abl"></span>';
                        news1Content +='<img style="width: 350px;" src="${APP_PATH}/'+news1[i].fface+'"/>';
                        news1Content +='<span class="abr"></span>';
                        news1Content +='</dt>';
                        news1Content +='<dd>'+news1[i].fname+'</dd>';
                        news1Content +='<dd><span>¥ '+news1[i].fprice.toFixed(2)+'</span></dd>';
                        news1Content +='</dl>';
                        news1Content +='</a>';
                    }
                    $("#news1").html(news1Content);

                    for(var i = 0 ; i < news2.length ; i ++){
                        news2Content +='<a href="${APP_PATH}/toFurnitureDetail?ktid='+news2[i].kt_ktid+'&fid='+news2[i].fid+'" >';
                        news2Content +='<dl>';
                        news2Content +='<dt>';
                        news2Content +='<span class="abl"></span>';
                        news2Content +='<img style="width: 350px;" src="${APP_PATH}/'+news2[i].fface+'"/>';
                        news2Content +='<span class="abr"></span>';
                        news2Content +='</dt>';
                        news2Content +='<dd>'+news2[i].fname+'</dd>';
                        news2Content +='<dd><span>¥ '+news2[i].fprice.toFixed(2)+'</span></dd>';
                        news2Content +='</dl>';
                        news2Content +='</a>';
                    }
                    $("#news2").html(news2Content);

                    for(var i = 0 ; i < news3.length ; i ++){
                        news3Content +='<a href="${APP_PATH}/toFurnitureDetail?ktid='+news3[i].kt_ktid+'&fid='+news3[i].fid+'" class="clearfix">';
                        news3Content +='<dl>';
                        news3Content +='<dt>';
                        news3Content +='<span class="abl"></span>';
                        news3Content +='<img style="width: 280px;" src="${APP_PATH}/'+news3[i].fface+'"/>';
                        news3Content +='<span class="abr"></span>';
                        news3Content +='</dt>';
                        news3Content +='<dd>'+news3[i].fname+'</dd>';
                        news3Content +='<dd><span>¥ '+news3[i].fprice.toFixed(2)+'</span></dd>';
                        news3Content +='</dl>';
                        news3Content +='</a>';
                        if(i >= 0 && i <= 3){
                            $("#news3_row1").append(news3Content);
                            news3Content = "";
                        }else if(i >= 4 && i <=7){
                            $("#news3_row2").append(news3Content);
                            news3Content = "";
                        }else{
                            $("#news3_row3").append(news3Content);
                            news3Content = "";
                        }
                    }
                }
            }
        });
    }
</script>


</body>
</html>

